{"id":658,"date":"2006-06-24T12:56:35","date_gmt":"2006-06-24T11:56:35","guid":{"rendered":"http:\/\/www.lubica.net\/bigwhale\/blog\/?p=658"},"modified":"2006-06-24T12:58:39","modified_gmt":"2006-06-24T11:58:39","slug":"ownal-sem-hello-world","status":"publish","type":"post","link":"https:\/\/lubica.net\/bigwhale\/blog\/ownal-sem-hello-world\/","title":{"rendered":"Ownal sem Hello World! ;)"},"content":{"rendered":"<p>Na <a href=\"http:\/\/www.slo-tech.com\">Slo-Techu<\/a> so se sli <a href=\"https:\/\/www.slo-tech.com\/script\/forum\/izpisitemo.php?threadID=224732\">kdo bo napisal<\/a> najkraj\u0161i <a href=\"http:\/\/en.wikipedia.org\/wiki\/Hello_world_program\">Hello World program<\/a>. Baje za Windows. Jaz sem se tega lotil na Linuxu.<br \/>\n[code]<br \/>\nBITS 32<br \/>\norg 0x08048000<br \/>\nehdr: ; Elf32_Ehdr<br \/>\ndb 0x7F, &#8220;ELF&#8221; ; e_ident<br \/>\ndb 1, 1, 1, 0<br \/>\nmsg db &#8220;Pozdrav&#8221;,0xa<br \/>\ndw 2 ; e_type<br \/>\ndw 3 ; e_machine<br \/>\ndd 1 ; e_version<br \/>\ndd _start ; e_entry<br \/>\ndd phdr &#8211; $$ ; e_phoff<br \/>\ndd 0 ; e_shoff<br \/>\ndd 0 ; e_flags<br \/>\ndw ehdrsize ; e_ehsize<br \/>\ndw phdrsize ; e_phentsize<br \/>\ndw 1 ; e_phnum<br \/>\ndw 0 ; e_shentsize<br \/>\ndw 0 ; e_shnum<br \/>\ndw 0 ; e_shstrndx<br \/>\nehdrsize equ $ &#8211; ehdr<br \/>\nphdr: ; Elf32_Phdr<br \/>\ndd 1 ; p_type<br \/>\ndd 0 ; p_offset<br \/>\ndd $$ ; p_vaddr<br \/>\ndd $$ ; p_paddr<br \/>\ndd filesize ; p_filesz<br \/>\ndd filesize ; p_memsz<br \/>\ndd 5 ; p_flags<br \/>\ndd 0x1000 ; p_align<br \/>\nphdrsize equ $ &#8211; phdr<br \/>\nfilesize equ $ &#8211; $$<br \/>\n_start:<br \/>\ninc     eax<br \/>\nmov     dl,8<br \/>\npusha<br \/>\nxchg    ax,bx<br \/>\nadd     ax, word 4<br \/>\nmov     ecx,msg<br \/>\nint     0x80<br \/>\npopa<br \/>\nint     0x80<br \/>\n[\/code]<\/p>\n<p>Executable, ki je dolg 104 byte in izpi\u0161e besedo Pozdrav. Stvar bi bila lahko \u0161e kraj\u0161a, vendar potem ELF header datoteke ne bi bil ve\u010d prepoznaven, zmutiliral bi ga lahko do amena! \ud83d\ude1b Sedaj pa je ELF header skoraj ((V prvih nekaj bytov ELF headerja sem stla\u010dil besedo Pozdrav, tam so bile sicer same ni\u010dle. What a waste of space! ;))) nedotaknjen.<\/p>\n<p>PS: Objavljena je ena izmed verzij programa, kjer sem se igral z osem bitnimi registri.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Na Slo-Techu so se sli kdo bo napisal najkraj\u0161i Hello World program. Baje za Windows. Jaz sem se tega lotil na Linuxu. [code] BITS 32 org 0x08048000 ehdr: ; Elf32_Ehdr db 0x7F, &#8220;ELF&#8221; ; e_ident db 1, 1, 1, 0 msg db &#8220;Pozdrav&#8221;,0xa dw 2 ; e_type dw 3 ; e_machine dd 1 ; e_version dd _start ; e_entry dd phdr &#8211; $$ ; e_phoff dd 0 ; e_shoff dd 0 ; e_flags dw ehdrsize ; e_ehsize dw phdrsize ;&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/lubica.net\/bigwhale\/blog\/ownal-sem-hello-world\/\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-658","post","type-post","status-publish","format-standard","hentry","category-open-source"],"_links":{"self":[{"href":"https:\/\/lubica.net\/bigwhale\/blog\/wp-json\/wp\/v2\/posts\/658","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lubica.net\/bigwhale\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lubica.net\/bigwhale\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lubica.net\/bigwhale\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/lubica.net\/bigwhale\/blog\/wp-json\/wp\/v2\/comments?post=658"}],"version-history":[{"count":0,"href":"https:\/\/lubica.net\/bigwhale\/blog\/wp-json\/wp\/v2\/posts\/658\/revisions"}],"wp:attachment":[{"href":"https:\/\/lubica.net\/bigwhale\/blog\/wp-json\/wp\/v2\/media?parent=658"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lubica.net\/bigwhale\/blog\/wp-json\/wp\/v2\/categories?post=658"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lubica.net\/bigwhale\/blog\/wp-json\/wp\/v2\/tags?post=658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}