News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

c to asm

Started by Jimg, March 09, 2009, 12:53:37 PM

Previous topic - Next topic

jj2007

Quote from: redskull on March 11, 2009, 03:25:24 AM
it's actually a little scary how similar low level C and MASM w/ high-level macros are to each other...

-ac

Hmmm... that depends strongly on which macros you use :green

  OPEN "O", #1, offset txGfaFile ; open a file for output
  PRINT #1, MID$(CAT$("We use a CAT$ for doing this test: ", chr$(13,10), offset txTestbed), 25)
  PRINT #1, offset txGpStr ; print another string to the file
  CLOSE ; close all files opened with OPEN
  OPEN "I", #1, offset txGfaFile ; open again for input
  .if eax!=INVALID_HANDLE_VALUE
INPUT #1, My$, LOF(#1) ; read all bytes to My$
MsgBox 0, My$, STR$("Here are %3f kBytes from the file we just wrote to:", LOF(#1)/1024), MB_OK
CLOSE #1     ; close only file No. 1 (the # is optional for CLOSE)
  .endif
  OPEN "O", #1, offset txGfaFileUc ; open a file for output
  PRINTW #1, offset MyW$ ; print a wide (Unicode) string to the file
  CLOSE 1 ; close only file No. 1
  OPEN "I", #2, offset txGfaFileUc ; open again for input
  INPUT #2, My$, LOF(#2) ; read all bytes to My$
  CLOSE ; close all files opened with OPEN

BlackVortex

BURN THE HERETIC !!!








:cheekygreen: