BBC BASIC for Windows
« Transfering a value using assembly language MOV »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 9:57pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Transfering a value using assembly language MOV  (Read 292 times)
michael
Senior Member
ImageImageImageImage


member is offline

Avatar




PM


Posts: 335
xx Transfering a value using assembly language MOV
« Thread started on: May 10th, 2016, 04:08am »

I finally found some extremely well made 32 bit general tutorials for assembly
language.
https://www.youtube.com/watch?v=IiEYxc3ZFog&list=PL4C2714CB525C3CD7&index=26

I guess ill share what I learned. It took a while to find a base program to work with and this has some code from the assembly language tutorials.

I got lucky and found 1 source snippet that I could test and modify as I am learning just 32 bit 8086 assembly language programming .. (thankfully)

From my lessons assembly registers must first be given a value and then the register can share a result to a variable.

So in this program, eax is a 32 bit register (that's all I am learning)
* bin% and bcd% are the original variables declared
at the start of the program in a DIM command..

mov eax,[bin%]

so first the value of bin% is moved into the 32 bit register eax

now this part I experimented with assuming if I could assign eax, with bin% then I could assign bcd% (my other variable from eax register value..
AND IT WORKED!!! HE HE HE

mov [bcd%],eax

So this program does just the simple job of transferring variable values within assembly.

Code:
 DIM bin% 3, bcd% 9
      PROCassemble
      REPEAT
        INPUT "Enter a number for eax register to recieve: " !bin%
        CALL bin2bcd
        PRINT ":eax gave bcd% your number ";!bcd%
      UNTIL FALSE
      END

      DEF PROCassemble
      LOCAL P%, L%
      DIM P% 12, L% -1
      [OPT 10
      .bin2bcd
      mov eax,[bin%]
      mov [bcd%],eax
      ret
      ]
      ENDPROC
 
« Last Edit: May 10th, 2016, 04:46am by michael » User IP Logged

I like making program generators and like reinventing the wheel
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls