?login_element?

Subversion Repositories NedoOS

Rev

Rev 129 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;; Test source for TAPOUT / TAPEND / OUTPUT / OUTEND ;;
  3. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  4.  
  5.         DEFINE  tape_file "tapout_test.tap"
  6.         DEFINE  pure_code "tapout_test.bin"
  7.  
  8.         db      1,1,1,1
  9.  
  10.         EMPTYTAP tape_file              ;; Create empty TAP file
  11.        
  12.         db      2,2,2,2
  13.  
  14.         TAPOUT  tape_file,0             ;; Basic header
  15.  
  16.         db      0x00                    ;; Header type = basic
  17.         db      'HelloWorld'            ;; File name
  18.         dw      baslen                  ;; Total length
  19.         dw      1                       ;; Start line
  20.         dw      baslen                  ;; Length of pure basic
  21.  
  22.         TAPEND                          ;; End of tape block
  23.  
  24.         db      3,3,3,3
  25.  
  26.         TAPOUT  tape_file               ;; Basic body
  27.  
  28. CODE    =       0xAF
  29. USR     =       0xC0
  30. LOAD    =       0xEF
  31. RANDOMIZE =     0xF9
  32.  
  33. basic   db      0,1                     ;; Line 1
  34.         dw      l1len                   ;; Length of line 1
  35. line1   db      LOAD,'""',CODE          ;; LOAD "" CODE
  36.         db      0x0D                    ;; End of line 1
  37.  
  38. l1len   =       $-line1
  39.  
  40.         db      0,2                     ;; Line 2
  41.         dw      l2len                   ;; Length of line 2
  42. line2   db      RANDOMIZE,USR           ;; RANDOMIZE USR
  43.  
  44.         LUA ALLPASS                     ;; Digits of number
  45.         _pc('db "' .. tostring(_c("start")) .. '"')
  46.         ENDLUA
  47.  
  48.         db      0x0E                    ;; Number follows
  49.         db      0x00,0x00               ;; 5 bytes of internal
  50.         dw      start                   ;; number representation
  51.         db      0x00
  52.         db      0x0D                    ;; End of line 2
  53.  
  54. l2len   =       $-line2
  55. baslen  =       $-basic
  56.  
  57.         TAPEND                          ;; End of tape block
  58.  
  59.         db      4,4,4,4
  60.  
  61.         TAPOUT  tape_file,0             ;; Bytes header
  62.  
  63.         db      0x03                    ;; Header type = bytes
  64.         db      'HelloWorld'            ;; File name
  65.         dw      codlen                  ;; Total length
  66.         dw      start                   ;; Start address
  67.         dw      0x8000
  68.  
  69.         TAPEND                          ;; End of tape block
  70.  
  71.         db      5,5,5,5
  72.  
  73.         TAPOUT  tape_file               ;; Bytes body
  74.         OUTPUT  pure_code               ;; Pure data file
  75.  
  76.         org     0x8000                  ;; Start address of code
  77.  
  78. start   ld      a,0x02                  ;; Channel 2
  79.         call    0x1601                  ;; is opened
  80.         ld      de,text                 ;; Address of text
  81.         ld      bc,txtlen               ;; Length of text
  82.         jp      0x203C                  ;; Jump to print text
  83.  
  84. text    db      13                      ;; Cursor to next line
  85.         db      19,1                    ;; BRIGHT 1
  86.         db      18,1                    ;; FLASH 1
  87.         db      'Hello world !'         ;; Text
  88.  
  89. txtlen  =       $-text
  90. codlen  =       $-start
  91.  
  92.         OUTEND                          ;; End of pure data file
  93.         TAPEND                          ;; End of tape block
  94.  
  95.         db      6,6,6,6
  96.  
  97. ;; Error cases
  98.  
  99.         SAVETAP "nothing",start         ;; No DEVICE defined
  100.  
  101.         TAPOUT  tape_file,              ;; No flagbyte
  102.         TAPOUT                          ;; No parameters
  103.  
  104. ;; End of test file
  105.