I'm a newbie in assembly
Google search was not helping much
can some1 tell me how to write %2 in assembly?

ps. there might be more question coming up since I'm trying to finish my HW

Re: how to write %2 in assembly?? 80 80

what is %2 supposed to mean? Or do you just want to print %2 on the console screen? If yes, then just use int 21 instructions to do that, assuming you are using Intel or compatible processor.

Re: how to write %2 in assembly?? 80 80

some NASM code I wrote for you..
tested on intel processor
much faster than int 21h.

jmp main
test1 db "%2",0
 mov ax,0xB800 ;video memory unless in graphics mode
 push es
 mov es,ax
 mov si,test1
 mov ah,0x07  ;colors
 xor bx,bx    ;use bx to position the output..
   mov al,[si+0]  ;get next char
   test al,al     ;set flags but don't change register value
     jz .done
   mov word[es:bx],ax ;display value in al
   inc si         ;next char
   add bx,2       ;es displays 2 bytes(attribute, char)
   jmp .write
   pop es
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.