|
Prev: Battleships - was:: a compainion book for aoa?
Next: Why bother subtracting for local variables? (x86 c calling convention)
From: Evenbit on 1 Jul 2008 21:13 Yep, Americanes Need 'Erbs ??? :) Yet Another Nerd Experience You Ain't No Expert Yonder Assembler Not Easy ;-------------------- ; nasm -f elf hw2uyane.asm ; ld -o hw2uyane hw2uyane.o %include "yanetut.inc" putstring "Please tell me your name? " getstring 79,name putstring "Hello, " putstring name putstring "! Welcome to Linux uhhh... Assembly!", linefeed putstring "BTW, the answer is " mov ecx, 42 mov ebx, 1 add ebx, ecx ; HLLp, I can't read this part!!! putnumber ebx putstring ", not " putnumber ecx putstring ". Deep Thought was off-by-one.", linefeed depart victorious ;----------------------- Nathan.
From: Frank Kotler on 1 Jul 2008 21:33 Evenbit wrote: > Yep, Americanes Need 'Erbs ??? :) > > Yet Another Nerd Experience > You Ain't No Expert > Yonder Assembler Not Easy You Are Not Expected To Understand This ;------------------------ ; yanetut.inc linefeed equ 10 %macro putstring 1+ %ifstr %1 section .data %%str db %1 %%strlen equ $ - %%str section .text pusha mov ecx, %%str mov edx, %%strlen %else section .text pusha mov ecx, %1 or edx, byte -1 %%getlen: inc edx cmp byte [ecx + edx], 0 jnz %%getlen %endif section .text call write_stdout popa %endmacro %macro getstring 2 section .bss %2: resb %1 section .text pusha mov edx, %1 mov ecx, %2 xor ebx, ebx push byte 3 pop eax int 80h mov byte [ecx + eax - 1], 0 popa %endmacro %macro putnumber 1 push dword %1 call showdec %endmacro victorious equ 0 abject equ -1 %macro depart 1 mov ebx, %1 push byte 1 pop eax int 80h %endmacro write_stdout: push byte 1 pop ebx push byte 4 pop eax int 80h ret read_stdin: xor ebx, ebx push byte 3 pop eax int 80h ret showdec: ; stdcall pusha mov eax, [esp + 4 + 32] mov ecx, esp sub esp, byte 16 mov ebx, 10 xor esi, esi ..top: dec ecx xor edx, edx div ebx add dl, '0' mov [ecx], dl inc esi test eax, eax jnz .top mov edx, esi call write_stdout add esp, byte 16 popa ret 4 global _start section .text _start: ; your code should start immediately after ; %include "yanetut.inc" ;---------------------- It *is* intended to be a joke, y'know... In view of that, I rather like your interpretations... Best, Frank
From: s_dubrovich on 1 Jul 2008 23:12
On Jul 1, 8:33 pm, Frank Kotler <fbkot...(a)verizon.net> wrote: > Evenbit wrote: > > Yep, Americanes Need 'Erbs ??? :) > > > Yet Another Nerd Experience > > You Ain't No Expert > > Yonder Assembler Not Easy > > You Are Not Expected To Understand This > > > ; your code should start immediately after > ; %include "yanetut.inc" > ;---------------------- > > It *is* intended to be a joke, y'know... In view of that, I rather like > your interpretations... > > Best, > Frank hmm, My first thought was that it was a contraction of the phrase: "you ain't sane." :) |