Newbas assembler help

Home › Forums › Emulator › Assembler › Newbas assembler help

  • Creator
    Topic
  • #3883
    rcmolina
    Participant
    • Topics: 8
    • Replies: 16
    • Total posts: 24
      Up
      0
      Down
      ::

      Hi my Friends,

      I’ve been playing a little bit, and finally I could assembler this Code

      10 ORG 16384

      20 LD A,1

      30 XOR A

      40 END

      ASSEMBLE

      ¿Any help for commands, in particular for loading/saving binary and source code?

      _

      Rafa

    Viewing 5 reply threads
    • Author
      Replies
      • #3884
        CDesp
        Keymaster
        • Topics: 15
        • Replies: 35
        • Total posts: 50
          Up
          0
          Down
          ::

          Hi,

          you can use the built in assembler of the emulator to put the code straight to memory.
          That is good for testing and fast development.
          For Newbas from what i remember you have to save the object file to disk or tape and then make a small
          basic loader to put the bytes to memory.
          Something like this ( i am doing this from memory so some mistakes my exist):
          tape must be at the start of the file, usually the loader precedes the object file, filename is optional
          10 Openin#1,1,”Filename.o”
          15 k=16384:n=<your filesize>
          20 for i=1 to n
          30 get#1,a:poke k,a:k=k+1
          40 next i
          45 close#1
          50 call 16384: Rem if you want to execute the code
          100 end

          for disk change line 10 to
          10 openin#9,9,”filename.o”
          filename is required

        • #3885
          rcmolina
          Participant
          Topic Author
          • Topics: 8
          • Replies: 16
          • Total posts: 24
            Up
            0
            Down
            ::

            Thanks CDesp,

            Very helpful. After assemblig I get a message showing tape is ready.

            First I’ll have to struggle to check how to save,  I suppose then there is not a guide / list of commands for Newbas assembler.

            _

            Rafa

          • #3889
            rcmolina
            Participant
            Topic Author
            • Topics: 8
            • Replies: 16
            • Total posts: 24
              Up
              0
              Down
              ::

              Hello CDesp,

              Sorry, but that’s an IA alucination.

              After playing around:

              LOAD FILENAME ; do not use quotes for loading source file

              SAVE FILENAME ; do not use quotes for saving source file

              ASSEMBLE FILENAME ; do not use quotes for saving compiled source code. After message Tape Ready, press enter for saving.

              Thanks anyway

              _

              Rafa

            • #3891
              CDesp
              Keymaster
              • Topics: 15
              • Replies: 35
              • Total posts: 50
                Up
                0
                Down
                ::

                You are right that was all wrong.

                Well here are the keywords i found from the binary

                AFTER ASSEMBLE IS FINISHED PRESSING A KEY SAVES THE BINARY FILE TO UNKNOWNx.BIN ON THE TAPE DIRECTORY
                ASSEMBLE COMPILES THE SOURCE
                LOAD LOADS THE SOURCE FILE (SELECT THE FILE TO LOAD FIRST)
                SAVE SAVES THE SOURCE TO UNKNOWNx.BAS
                DEL <LINENO> DELETES A LINE
                LIST
                NEW CLEARS THE CURRENT PROGRAM
                OLD REINSTATES THE OLD PROGRAM USE AFTER NEW
                PLIST LISTS TO THE PRINTER ANSWER Y ON START (ON THE EMULATOR THAT IS PRINTERNEW.PRN)
                REN <NUMBER> IT RENUMBERS ALL COMMANDS FROM NUMBER (10 IS THE SPACING)
                MEMORY SHOWS FREE MEMORY
                DLOAD NOT WORKING ON TAPE (DISK)
                DSAVE NOT WORKING ON TAPE (DISK)
                RUN LOADS FROM TAPE BUT WHAT
                MAN CRASHES

                • This reply was modified 1 month ago by CDesp.
              • #3893
                rcmolina
                Participant
                Topic Author
                • Topics: 8
                • Replies: 16
                • Total posts: 24
                  Up
                  0
                  Down
                  ::

                  Many thanks again CDesp four your help 😉

                  Also I observe that ASSEMBLE is only into file. Using NewBrainemu I checked nothing is poked into memory.

                  RUN also is a mistery to me, after executing, the listing is lost forever.

                  –

                  Rafa

                • #3894
                  rcmolina
                  Participant
                  Topic Author
                  • Topics: 8
                  • Replies: 16
                  • Total posts: 24
                    Up
                    0
                    Down
                    ::

                    Hi CDesp,

                    Finally understood RUN command.

                    You have first tonplace the tape with output compiled code with ASSEMBLE in the emulator

                    After executing RUN a message shows Tape in Ready. Press Enter, and then loads into memory and execute the code 🙂

                    _

                    Rafa

                Viewing 5 reply threads
                • You must be logged in to reply to this topic.