flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > [FASMG] sprintf display/db formatted text |
Author |
|
codestar 07 May 2015, 16:17
sprintf-style display(...) (or db). See attachment.
Code: include 'printf.txt' ; sprintf(console, "i=%d\nh=$%x\n\n",\ ; 123, 0x12345678) i=123 j=$12345678 displayf 'i=', i&d, &r, 'h=$', j&h, &r, &r name equ 'Master' age=37 displayf \ 'Hi, ', name, '. You are ', age&d, &r,\ 'years old which is ', &r, age&b, 'b',\ &r, 'in binary and ', &r, age&h,\ 'h in hexadecimal.', &r, &r define o1_name eax define o2_name ecx o1_type='r' o2_type='i' o1_value=0 o2_value=$CAFEBABE if o1_type='r' & o2_type='i' displayf 'mov ', `o1_name,\ ', $', o2_value&h, &r end if
|
|||||||||||
07 May 2015, 16:17 |
|
uor99 03 Oct 2016, 03:48
Great job ! Thanks.
|
|||
03 Oct 2016, 03:48 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.