Search found 21 matches

by hmn
Thu Oct 03, 2024 7:35 am
Forum: Programming
Topic: Crenshaw - Let's Build a Compiler
Replies: 102
Views: 24016

Re: Crenshaw - Let's Build a Compiler

barnacle wrote:
Annoying that the code tags do strange things to formatting.
Are you talking about the indentation? At first I thought that was intentional to make it easier to follow the branching. After reading this comment, my guess is you have mixed spaces and tabs in your code :)
by hmn
Tue Nov 14, 2023 9:19 am
Forum: Programming
Topic: CC65 - Inline assembly return values?
Replies: 6
Views: 2352

Re: CC65 - Inline assembly return values?

See also here: Calling assembly functions from C .

int getch(void)
{
char c;
__asm__ ("JSR $8A5A");
__asm__ ("STA %b", c);
return c;
}


That does not compile due to "%b" requiring a literal. Since "c" is a local variable, I don't think it can be accessed easily here. It should work by making ...
by hmn
Sun Jan 22, 2023 1:01 am
Forum: Hardware
Topic: Don't write to ROM
Replies: 23
Views: 2491

Re: Don't write to ROM

is this actually a concern? like if you don't want the ability to write to the ROM couldn't you just pull the WE line of the ROM/FLASH chip permanently high?
I assume that the issue is not "overwriting" the ROM, but rather the CPU and ROM both trying to drive the data bus during the write cycle.
by hmn
Sat Jan 21, 2023 9:58 pm
Forum: Hardware
Topic: Don't write to ROM
Replies: 23
Views: 2491

Re: Don't write to ROM

Rom chips usually have distinct CS and OE lines - so you could still "select" the chip on a write cycle, as long as you don't enable the output.
by hmn
Sun May 08, 2022 7:24 am
Forum: Programming
Topic: ACME memory allocation macro and oversized addressing
Replies: 9
Views: 1379

Re: ACME memory allocation macro and oversized addressing

I don't think ACME has segment support.

Out of the assemblers I frequently use, 64tass (aka tass64) has "sections", and ca65 (from cc65) has segments, along with a linker.
by hmn
Thu Feb 10, 2022 5:21 pm
Forum: Programming
Topic: EZ Build environment for Fuzix for the 6502
Replies: 1
Views: 850

Re: EZ Build environment for Fuzix for the 6502

Quote:
sudo git clone https://github.com/EtchedPixels/FUZIX.git
sudo chown -R km FUZIX (note: change km to your user name)
Or leave out the "sudo" in the first command, then you don't need the second command at all :)
by hmn
Thu Jan 27, 2022 5:54 pm
Forum: Newbies
Topic: org $80
Replies: 4
Views: 1171

Re: org $80

I am assuming the code samples are for DASM, as that seems to be a popular choice for 2600 coding, and it has an RORG directive.

org $f000
As Garth said, this sets the address where the assembler will put the code, but in the case of a cross assembler like DASM, the code is not
placed in the ...
by hmn
Wed Sep 15, 2021 8:56 pm
Forum: Newbies
Topic: Using ACME, how do I work with code in multiple files?
Replies: 5
Views: 1547

Re: Using ACME, how do I work with code in multiple files?

So, if file A depends on File B and C, and File B and C both depend on file D, What file should include what?
If you separate code from definitions, that question is easy to answer: You include the definitions wherever you depend on them, and you include the code wherever you want it to be placed ...
by hmn
Wed Sep 15, 2021 4:45 am
Forum: Newbies
Topic: Using ACME, how do I work with code in multiple files?
Replies: 5
Views: 1547

Re: Using ACME, how do I work with code in multiple files?

These include guards don't work like they would in C, because there is no preprocessor pass, just two assembler passes.

The "Symbol already defined." error in Acme (in the other thread) is caused by the code from the included file not being assembled during the second pass, thus changing the value ...
by hmn
Thu Apr 01, 2021 4:15 pm
Forum: Programming
Topic: Pre-padding rom with zeroes in cc65
Replies: 6
Views: 1291

Re: Pre-padding rom with zeroes in cc65

Some ways to set this up in the ld65 linker config:

16K padding section:

MEMORY {
DUMMY: start = $8000, size = $4000, type = ro, fill = yes;
ROM: start = $C000, size = $4000, type = ro, fill = yes;
}

SEGMENTS {
CODE: load = ROM, type = ro;
}

32K section with coded loaded at 16K offset ...
by hmn
Fri Dec 06, 2019 6:53 pm
Forum: Emulation and Simulation
Topic: A MUST-READ for anyone attempting 'mulation
Replies: 23
Views: 3784

Re: A MUST-READ for anyone attempting simulation

The article claims that computed goto does not work as expected in GCC, this article from 2012 claims otherwise.

Also I am wondering how you would implement stuff like pausing and single stepping without a dispatch loop, which to me would be much more important features for an *mulator than ...
by hmn
Sun Nov 03, 2019 7:51 am
Forum: Programming
Topic: Yet anther assembler...
Replies: 22
Views: 2836

Re: Yet anther assembler...

... but I do like to see on the list file exactly what I'm getting.
Every macro assembler I've seen shows exactly what you're getting from the macros unless you tell it not to.
I recently evaluated a couple, and found that this cannot be taken for granted. Out of the five I have looked at:

- xa ...
by hmn
Mon Oct 08, 2018 11:27 am
Forum: General Discussions
Topic: WDC & IoT
Replies: 3
Views: 2644

Re: WDC & IoT

GaBuZoMeu wrote:
I've just got advertising news from WDC...
Bare-bones FPGA board with 65xx softcores = "IoT platform"? Advertising indeed :D Notice how for the demo, they hook it up to an actual IoT platform.
by hmn
Thu Aug 30, 2018 6:45 am
Forum: Newbies
Topic: Branching - how does it work?
Replies: 14
Views: 5062

Re: Branching - how does it work?

Code: Select all

lda     _variable
cmp     #$10
L001F:   bcs     L001F
That is simply an endless loop if _variable >= 16. So that is equivalent to your C code. The compiler just decided to implement your endless loop twice.