flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Macroinstructions > [FASMG] sprintf display/db formatted text

Author
Thread Post new topic Reply to topic
codestar



Joined: 25 Dec 2014
Posts: 254
[FASMG] sprintf display/db formatted text
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 ', &rage&b'b',\
  &r'in binary and ', &rage&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



Description:
Download
Filename: printf.zip
Filesize: 1.75 KB
Downloaded: 31 Time(s)

Post 07 May 2015, 16:17
View user's profile Send private message Reply with quote
uor99



Joined: 04 Dec 2014
Posts: 39
Great job ! Thanks.
Post 03 Oct 2016, 03:48
View user's profile Send private message ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.