Author Topic: GoDevTool Debugger doesn't like this line of code  (Read 15274 times)

Offline OpAmp

  • New Member
  • Posts: 1
GoDevTool Debugger doesn't like this line of code
« on: December 29, 2019, 08:34:03 PM »
https://imgur.com/1YWkAyo

Here's what I'm trying to do:
//Develop a sequence of instructions that converts the unsigned number in AX (values of
//0–65535) into a 5-digit BCD number stored in memory, beginning at the location addressed
//by the BX register in the data segment. Note that the most significant character is stored
//first and no attempt is made to blank leading zeros.


I'm trying to load the contents of AL into the location addressed by the BX register in the data segment, but the debugger doesn't seem to like my code:
MOV [EBX], AL;

Any thoughts?

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: GoDevTool Debugger doesn't like this line of code
« Reply #1 on: December 30, 2019, 03:28:52 AM »
Hi OpAmp,

Welcome to the forum.

I'm afraid I'm confused. Your code looks like 16 bit,but the exception looks like 'doze.

What command line did you give Nasm? How are you trying to run this?

I'm not very familiar with GoDev. Maybe ask at Jeremy's site?

Best,
Frank


Offline Structure

  • Jr. Member
  • *
  • Posts: 21
« Last Edit: January 08, 2020, 07:58:06 PM by Structure »

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: GoDevTool Debugger doesn't like this line of code
« Reply #3 on: January 09, 2020, 01:23:08 AM »
Nice links, Structure, but what's your point? What are you saying OpAmp should have done?

Best,
Frank


Offline Structure

  • Jr. Member
  • *
  • Posts: 21
Re: GoDevTool Debugger doesn't like this line of code
« Reply #4 on: January 10, 2020, 04:58:35 PM »
Quote
What are you saying OpAmp should have done?

I'm no assembly expert it's just a thought...
Perhaps try: movzx ?

Offline debs3759

  • Global Moderator
  • Full Member
  • *****
  • Posts: 224
  • Country: gb
    • GPUZoo
Re: GoDevTool Debugger doesn't like this line of code
« Reply #5 on: January 10, 2020, 10:49:09 PM »
Quote
What are you saying OpAmp should have done?

I'm no assembly expert it's just a thought...
Perhaps try: movzx ?

No such thing as

movzx mem,reg

but

Code: [Select]
MOVZX   EDX,AL
MOV     [EBX],EDX

would do it.

Sadly that doesn't solve the actual problem, it only fixes the posted instruction :)

I'll help more with the homework when OpAmp figures posts an attempt to convert to BCD :)

The docs from nasm 0.98 contain a full description of all instructions, if you need it.

I will look up how I did this, it's been a while :)
My graphics card database: www.gpuzoo.com