home *** CD-ROM | disk | FTP | other *** search
/ ftp.uni-stuttgart.de/pub/systems/acorn/ / Acorn.tar / Acorn / riscos / problems / asm-c / c2asm-example.text next >
Text File  |  1991-04-25  |  567b  |  33 lines

  1. c:
  2.  
  3. int NiceInt;
  4. char BeautifulChar[20];
  5.  
  6. int main(void) {
  7.   .
  8.   .
  9.   DoSomething();
  10. }
  11.  
  12.  
  13. Assembler:
  14.  
  15.                 .PROC  DoSomething
  16.  
  17.                 .IMPORT NiceInt
  18.                 .IMPORT BeautifulChar
  19.  
  20.                 LDR     R1,AdrsNiceInt
  21.                 MOV     R0,#0
  22.                 STR     R0,[R1]         ; set NiceInt to 0
  23.                 LDR     R2,AdrsBeautiful
  24.                 STRB    R0,[R2]         ; set BeautifulChar to ""
  25.                 MOVS    PC,R14
  26.  
  27. AdrsNiceInt     .WORD   NiceInt
  28. AdrsBeautiful   .WORD   BeautilfulChar
  29.  
  30.    .END
  31.  
  32.  
  33.