68000

Writing an OS for Motorola 68K processor. Can I emulate it? And can I test-drive OS development?

家住魔仙堡 提交于 2020-01-21 04:28:05
问题 Next term, I'll need to write a basic operating system for Motorola 68K processor as part of a course lab material. Is there a Linux emulator of a basic hardware setup with that processor? So my partners and I can debug quicker on our computers instead of physically restarting the board and stuff. Is it possible to apply test-driven development technique to OS development? Code will be mostly assembly and C. What will be the main difficulties with trying to test-drive this? Any advice on how

Assembly Random Number within Range using Easy 68K (68000)

安稳与你 提交于 2019-12-31 02:46:27
问题 I'm creating a simple black jack game using the Easy 68K simulator and need to use a random number to assign the cards. My cards must be in the range 2 to 11. I seem to be getting the same number every time, and it isn't within the range I expect. My card value needs to end up in D3, so I have the following random number code: CLR.L D0 CLR.L D3 MOVE.B #8, D0 ;Access time TRAP #15 AND.L #$5FFFFF,D1 ;prevent overflow in divu DIVU #10, D1 SWAP D1 ADDQ.W #1, D1 MOVE D1, D3 which I came to by

Help with 68k assembly - jump tables?

巧了我就是萌 提交于 2019-12-21 07:27:12
问题 I'm working on reverse engineering a large Amiga program in IDA, and I've made a ton of progress. However, there is some stuff I can't quite figure out. Namely, I have found several subroutines which use what I believe to be "jump tables" - but I can't quite figure out how they work. Does anyone have any advice? moveq #0,d0 move.b d7,d0 ; set D0 to a byte from CTRL subq.w #1,d0 ; subtract 1 from it blt.w finish_29ABA ; if D0 is less than 1, branch cmpi.w #$16,d0 bge.w finish_29ABA ; if D0 is

Understanding the “S[cc]” instructions of 68000 assembly

删除回忆录丶 提交于 2019-12-11 13:23:42
问题 I'm trying to understand the "S[cc]" set of instructions in 68000 assembly. The format of the instruction is this: S[cc] reg [cc] is a condition code (for example, SEQ means "set if equals"). If the condition specified by [cc] is true, the register is set to all 1 s. Otherwise, the register is set to all 0 s. There's one thing I don't understand: where does the S[cc] operation look to check if the condition is true? Does it check the flags? If so, than if I want register D0 to hold the result

Why address register postincrement is (A0)+

对着背影说爱祢 提交于 2019-12-11 11:09:28
问题 Basically in the assembly language of 68000 to postincrement an address register you have to do: (A0)+ Example MOVE (A0)+,D0 This will move into D0 the value pointed by address of A0 and also will increment A0 by 1. Considering that (A0) is the value pointed by A0 wasn't better if the postincrement syntax was: (A0+) ? Or I am missing something? 回答1: MOVE.L (A1)+,D0 ; increments A1 by 4, because it is long operation ; and 4 is size of long I think that current postincrement syntax points at

VASM cross-assembler issue (m68k)

可紊 提交于 2019-12-11 06:39:31
问题 I'm wondering if anyone can help me with an annoying issue I face using VASM assembler to compile MC68000 binaries for Amiga. The problem lies in buggy (I think) implementation of labels' addresses manipulations. Here are the details: copper_scr: dc.w $e0, (screen>>16) & $ffff dc.w $e2, screen & $ffff ... screen: dcb.w screen_size ; screen_size value does not matter here What I'm trying to do in the code above is to split screen address into most significant word and less significant word in

Easiest way to merge 2 or more ELF files

穿精又带淫゛_ 提交于 2019-12-10 18:26:42
问题 I'm working on some embedded code for a class project that currently (per requirements) creates a number of srec files and merges them. I'd like to be able to load this code into QEMU, but it is generally only happy with ELF files. What is the esiest way to merge the original ELF files instead of the srecs. Also acceptable, a method to convert the srec back into an ELF and have the resulting file be loadable (objcopy seems to produce fairly broken files doing this (no architecture amoung

What is PC-relative addressing and how can I use it in MASM?

早过忘川 提交于 2019-12-10 18:03:02
问题 I'm following Jack Crenshaw's compiler tutorial (If you look at my profile, that's what all my questions are about lol) and it just got to the point where variables are introduced. He comments that the 68k requires everything to be "position-independent" which means it's "PC-relative". I get that PC is the program counter, and on x86 it's EIP. But he uses syntax like MOVE X(PC),D0 where X is a variable name. I've read a little ahead and it says nothing later about declaring a variable in

CCR on the 68000

让人想犯罪 __ 提交于 2019-12-06 09:14:13
问题 So i was asked an assembly question from a friend who is also trying to learn and understand the language. He asked: Given the following register values: D0: 364B 421E D1: F3FC 9066 after execution of the instruction: cmp.w D0,D1 what would be the resulting values in the CCR: N: Z: V: C: and whether or not each of the following branches to would occur: BLO <Label> Yes or No? BVC <Label> Yes or No? BGE <Label> Yes or No? BMI <Label> Yes or No? BLT <Label> Yes or No? BCS <Label> Yes or No? Can

CCR on the 68000

不打扰是莪最后的温柔 提交于 2019-12-04 17:55:24
So i was asked an assembly question from a friend who is also trying to learn and understand the language. He asked: Given the following register values: D0: 364B 421E D1: F3FC 9066 after execution of the instruction: cmp.w D0,D1 what would be the resulting values in the CCR: N: Z: V: C: and whether or not each of the following branches to would occur: BLO <Label> Yes or No? BVC <Label> Yes or No? BGE <Label> Yes or No? BMI <Label> Yes or No? BLT <Label> Yes or No? BCS <Label> Yes or No? Can someone help me out in understanding it as well that way when i explain it to him, i can deepen my