home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / nasmide.zip / examples / Errors.asm < prev    next >
Assembly Source File  |  1997-12-21  |  2KB  |  60 lines

  1.  Information
  2.  ▀▀▀▀▀▀▀▀▀▀▀
  3.  
  4.   Program Title : NASM-IDE error information test
  5. ;  External name : ERRORS.COM
  6. ;  Version       : 1.0
  7. ;  Start date    : 21/12/1997
  8. ;  Last update   : 21/12/1997
  9. ;  Author        : Rob Anderton
  10. ;  Description   : A simple example error information display.
  11.                    Written using NASM-IDE 1.1 and NASM 0.95.
  12.  
  13. ;                  NOTE: This code is full of errors and will not assemble!
  14.  
  15. BITS 16]                    ; Set 16 bit code generation
  16. [ORG x0100]                 ; Set code start address to 100h (COM file)
  17.  
  18. [SECTION .texts]              ; Section containing code
  19.  
  20.     jmp    START             ; Jump to label 'START' in .text section
  21.  
  22. END:                         ; Define label 'END'
  23.  
  24.     mov    ax, $4C00         ; This function exits the program
  25.     int    $21               ; and returns control to DOS.
  26.  
  27. START:    
  28.  
  29.     mov    BYTE [bss_sym], 'I   ; Reference a symbol in the .bss section
  30.     mov    bx, [bssptr]             ; Reference a symbol in the .data section
  31.     mov    al, [bx]
  32.     mov    bx, [DATAPTR]    
  33.     mov    [bx, al
  34.     mov    cx, 2
  35.  
  36. .LOOP:                           ; Define a local label
  37.  
  38.     mov    dx, datasym    
  39.     mov    ah, 9
  40.     push   cx
  41.     int    $21
  42.     pop    cx
  43.     loop   .LOOP        
  44.     mov    bx, [textptr]    
  45.     jmp    bx
  46.  
  47.  
  48. [SECTION .dataandstuff]                 ; Section containing initialised data
  49.  
  50. datasym      db 'NASM-EDE!', 13, 10, '$'
  51. bssptr      dw bss_sym        
  52. DATAPTR      dw datasym + 5    
  53. textptr      dw END            ; Pointer to a label in the .text section
  54.  
  55.  
  56. [SECTION .bss                  ; Section containing unitialised data
  57.  
  58. bss_sym      resb 1         Reserve 1 byte of data
  59.  
  60.