Jump to content
IGNORED

Displaying text in assembly


samishal

Recommended Posts

Well I have made tons of Video on how to do GPL and it is very similar.

http://www.atariage....ment-resources/

This has all the Zip files links to the videos.

I should add that the sequence of learning goes Basic, Extended Basic, GPL, Assembly or Forth or C.

You also have Logo or Pascal that is like between XB and GPL so watch my videios on GPL and it should help.

Edited by RXB
Link to comment
Share on other sites

Hi there,

 

I cant seem to get my program to display any text properly so was wondering if there was the source for a "hello world" program in assembly floating about which i could use. Also if you knwo any sites that have any tutorials on this, that would also be useful.

 

 

Samishal

 

 

 

How about........

 

 

 

def start

ref vmbw

start li r0,40

li r1,hworld

li r2,11

blwp @vmbw

die limi 2

jmp die

end start

hworld text 'hello world'

Edited by marc.hull
Link to comment
Share on other sites

Also if you know any sites that have any tutorials on this, that would also be useful.

 

I would have to say this forum is very useful... Start here: http://www.atariage.com/forums/topic/162941-assembly-on-the-994a/

 

Here are two examples without dependencies:

 

      DEF  MAIN

VDPWD  EQU  >8C00             * VDP write data
VDPWA  EQU  >8C02             * VDP set read/write address
WS1    EQU  >8300             * Workspace memory in fast RAM
R0LB   EQU  WRKSP+1           * Register zero low byte address

MSG1   TEXT 'HELLO WORLD'
MSG1E
      EVEN

MAIN   LIMI 0                 * Disable interrupts
      LWPI WRKSP             * Load the workspace pointer to fast RAM

* Clear the screen
      CLR  R0                * Start at top left corner of the screen
      LI   R1,>2000          * Write a space (>20 hex is 32 decimal)
      LI   R2,768            * Number of bytes to write

      MOVB @R0LB,@VDPWA      * Send low byte of VDP RAM write address
      ORI  R0,>4000          * Set read/write bits 14 and 15 to write (01)
      MOVB R0,@VDPWA         * Send high byte of VDP RAM write address

CLS    MOVB R1,@VDPWD         * Write byte to VDP RAM
      DEC  R2                * Byte counter
      JNE  CLS               * Check if done

* Write the text message to the screen
      LI   R0,395            * Screen location to display message
      LI   R1,MSG1           * Memory location of source data
      LI   R2,MSG1E-MSG1     * Length of data to write

      MOVB @R0LB,@VDPWA      * Send low byte of VDP RAM write address
      ORI  R0,>4000          * Set read/write bits 14 and 15 to write (01)
      MOVB R0,@VDPWA         * Send high byte of VDP RAM write address

DISP   MOVB *R1+,@VDPWD       * Write a byte of the message to the VDP
      DEC  R2                * Byte counter
      JNE  DISP              * Check if done

      LIMI 2                 * Enable interrupts
INFLP  JMP INFLP              * Infinite loop

      END

 

 

      DEF  MAIN

* VDP Memory Map
*
VDPRD  EQU  >8800             * VDP read data
VDPSTA EQU  >8802             * VDP status
VDPWD  EQU  >8C00             * VDP write data
VDPWA  EQU  >8C02             * VDP set read/write address

* Workspace
WRKSP  EQU  >8300             * Workspace
R0LB   EQU  WRKSP+1           * R0 low byte reqd for VDP routines

* Data
MSG1   TEXT 'HELLO WORLD'
MSG1E
      EVEN

* Program execution starts here
MAIN   LIMI 0
      LWPI WRKSP

* Clear the screen
      LI   R0,>0000          * Start at upper left corner of the screen, assume name table is at >0000
      LI   R1,>2000          * Write >20 (32 decimal), remember the MSB is sent to the VDP
      LI   R2,768            * 768 screen locations (32x24 tiles)
      BL   @VSMW             * Write the space 768 times

* Write the text message to the screen
      LI   R0,395            * Screen location to display message
      LI   R1,MSG1           * Memory location of source data
      LI   R2,MSG1E-MSG1     * Length of data to write
      BL   @VMBW

      LIMI 2
LP9999 JMP  LP9999


*********************************************************************
*
* VDP Single Byte Multiple Write
*
* R0   Starting write address in VDP RAM
* R1   MSB of R1 sent to VDP RAM
* R2   Number of times to write the MSB byte of R1 to VDP RAM
*
* R0 is modified, but can be restored with: ANDI R0,>3FFF
*
VSMW   MOVB @R0LB,@VDPWA      * Send low byte of VDP RAM write address
      ORI  R0,>4000          * Set read/write bits 14 and 15 to write (01)
      MOVB R0,@VDPWA         * Send high byte of VDP RAM write address
VSMWLP MOVB R1,@VDPWD         * Write byte to VDP RAM
      DEC  R2                * Byte counter
      JNE  VSMWLP            * Check if done
      B    *R11
*// VSMW


*********************************************************************
*
* VDP Multiple Byte Write
*
* R0   Starting write address in VDP RAM
* R1   Starting read address in CPU RAM
* R2   Number of bytes to send to the VDP RAM
*
* R0 is modified, but can be restored with: ANDI R0,>3FFF
*
VMBW   MOVB @R0LB,@VDPWA      * Send low byte of VDP RAM write address
      ORI  R0,>4000          * Set read/write bits 14 and 15 to write (01)
      MOVB R0,@VDPWA         * Send high byte of VDP RAM write address
VMBWLP MOVB *R1+,@VDPWD       * Write byte to VDP RAM
      DEC  R2                * Byte counter
      JNE  VMBWLP            * Check if done
      B    *R11
*// VMBW

      END

 

Link to comment
Share on other sites

I cant seem to get my program to display any text properly so was wondering if there was the source for a "hello world" program in assembly floating about which i could use.

 

 

I assume you know how to enter code, assemble and run then. Many ways lead to Rome, be it cross assembly, emulation or real iron.

 

Also if you knwo any sites that have any tutorials on this, that would also be useful.

 

I assume you have the Editor/Assembler manual. If not good, then at least reference for the instructions.

 

Then there's many nice Assembly books available for download on the TI-99/4A Home Computer Book Archive.

 

:)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...