Questions tagged [easy68k]

`EASy68K` is a 68000 Structured Assembly Language `IDE`. `EASy68K` allows you to edit, assemble and run 68000 programs on a Windows PC or Wine. No additional hardware is required. `EASy68K` is an open source project distributed under the GNU general public use license.

EASy68K is a 68000 Structured Assembly Language IDE. EASy68K allows you to edit, assemble and run 68000 programs on a Windows PC or Wine. No additional hardware is required. EASy68K is an open source project distributed under the GNU general public use license.

85 questions
4
votes
5 answers

How can I turn an odd number even, or vice versa, in Motorola 68000 Assembly?

Basically if I had a number in D1, and wanted it to ALWAYS be even, how would I make sure it is never odd? I know it has something to do with the AND instruction. But when I tried that, it would always subtract 1. So it would turn odd numbers even…
4
votes
1 answer

Display Register in decimal - assembly language EASy68K

I am trying to display D0 in decimal, but when I run the program, nothing is displayed. I don't get any errors, and when I look in register D0 I see the expected number in hex, but the decimal equivalent isn't being displayed. I am trying to use…
Bryan
  • 2,951
  • 11
  • 59
  • 101
3
votes
2 answers

Why is value passed at 0(SP) is acessible only at 4(SP)?

Why is value passed at 0(SP) is acessible only at 4(SP)? for example I need to pass a number to printn by 0(SP) instead of 4(SP) (as it's used in the routine) or it will not work. What am I missing? MOVE #12,D0 MOVE D0,0(SP) here I use 0…
The Mask
  • 17,007
  • 37
  • 111
  • 185
3
votes
1 answer

Pass a memory address by register

How do I pass a memory address from a register to other? My following routine receive the string memory address from stack (yes, it's necessary) and then try to put into D1 registers but it doesn't work and EASy68k emulator crash (or goes in an…
The Mask
  • 17,007
  • 37
  • 111
  • 185
2
votes
1 answer

How to implement logical OR || in an if() condition in easy68k?

Suppose I have a to compare a data register and i have to compare it to equalling one of 2 numbers. how would i go about that? I know how to do it for just comparing with one number not 2. CMP #0, D3 BNE ELSE REST OF THE CODE HERE How do i compare…
romano
  • 23
  • 2
2
votes
2 answers

68k Assembly: Does the CPU does store the status register on interrupt?

I have not been able to find any information as to whether the MC68000 preserves its status register / CCR during external interrupts. I imagine it would be an issue if the CPU were to interrupt immediately before a conditional branch, and the…
cjgriscom
  • 176
  • 1
  • 12
2
votes
3 answers

How do I move a byte into a specific location in a data register?

I want to move 4 bytes, $B1,B2,B3,B4, one at a time, into data register D1. The value I want in D1 is $B1B2B3B4. Which instruction(s) will help me do this?
Plaidypus
  • 81
  • 9
1
vote
2 answers

Motorola 68k: Convert number to ascii

I want to convert unsigned numbers to an ascii string in 68k asm. I can do this for something in the range of words: move.w #12345,d0 ;example number to convert (unsigned word) lea text,a0 ;adress of output string ;first digit and.l…
Steve_I
  • 51
  • 7
1
vote
2 answers

Use a single character for use in a comparison statement - Assembly (Motorola 68k)

I have this C++ code I'm trying to replicate in Assembly (68K): int main() { int i=0; char *string = "This is a string" while(string[i]!=' ') { /.../ i++; } return 0; } I'm stuck on the string[i]!=0, indexing…
Nathan
  • 1,393
  • 1
  • 9
  • 40
1
vote
1 answer

Descending bubblesort with 68k

i'm learning Assembly on Motorola 68k, i was able to do BubbleSort in ascending order but not descending, i don't know why the program goes into infinite loop; Thx!; The code: ORG $2000 START LEA ARRAY,A0 CLR D0 *Flag di scambio …
1
vote
0 answers

How to code simple Additions / Divisions in 68k Assembly?

I am totally new to Assembly68k and it is difficult for me to find instructive code that helps me learning. I want to write a very simple program to begin with: Define variable A = 100. Calculate the inverse i.e. calculate 1/A Divide by the outcome…
spadel
  • 998
  • 2
  • 16
  • 40
1
vote
1 answer

How do I display Task #8 in EASy68k?

I want to run TRAP #8 on EASy68k, which by definition, "Returns the time in hundredths of a second since midnight in D1.L." My current code is below. How would I display it? ORG $1000 START: MOVE #8,D0 TRAP #15 SIMHALT …
Polydynamical
  • 242
  • 3
  • 18
1
vote
3 answers

assembly 68k - clear starting from address efficently

This is my snippet to clear data from SCREEN address to 600 bytes. lea SCREEN,a3 move.w #(600/4)-1,d0 ; bytes / 4 bytes (long) clear_data: clr.l (a3)+ dbra d0,clear_data This works, however I wonder how to achieve the same…
Fabrizio Stellato
  • 1,727
  • 21
  • 52
1
vote
3 answers

Easy68k, Implementing this while loop

int X = 0; int Y = 1; while(X <= 10 ){ if(X%2 == 0) Y = Y * X; else Y++; X++; } cout << "Y is: " << Y; This is what I have for my Easy68k code. ORG $1000 START: ; first instruction of…
1
vote
1 answer

68K Assembly: Search number in numbers file

I am using Easy68k to write an assembly program, where I have to write a script for searching a number inside a file with numbers. File numbers4.txt : 1 2 3 4 5 6 7 9 11 12 13 14 My Code : ORG $1000 START: ; first…
Saad A
  • 1,135
  • 2
  • 21
  • 46
1
2 3 4 5 6