Giter VIP home page Giter VIP logo

Comments (6)

EtchedPixels avatar EtchedPixels commented on July 17, 2024

Can you share a test case and command line used. Those two should both be coming from lib6803.a so either it didn't build right in your case or there is some pattern of linkage that is messing up and not including these two functions.

There's no provision for inline asm in the compiler - just linking with files built with the assembler.

from cc6303.

kikich10 avatar kikich10 commented on July 17, 2024

Yes, of course, with this little source code, the error appears with me:

#include <stdio.h>
void main() {
    uint16_t value=255;
    value = value/55;
}

The command line to compile is:
cc68 -tmc10 ./test.c -o test

I’m quite new to programming.
Can you quickly explain how to link an asm file?

from cc6303.

EtchedPixels avatar EtchedPixels commented on July 17, 2024

I have pushed a patch to fix this (it got broken due to a change for the other compiler that uses these assembler/linker tools).

For assembly an example might be simplest


foo.c:

extern int bar(void);
int foo(void) { return bar(); }

bar.s

.setcpu 6803
.export _bar
      .code
_bar:
       ldd #1234
      addd _xyz
      rts

     .data
_xyz: .word 0

cc -tmc100 foo.c bar.s

C puts "_" in front of all user function and variable names. They also need to exported on the asm side to be visible in C.

You can also access arguments in asm functions. They are pushed on the stack before
the call so if you use TSX LDD offset,X you can access them.

The assembler code doesn't need to preserve D X or the flags

from cc6303.

EtchedPixels avatar EtchedPixels commented on July 17, 2024

If the Alice32 would benefit from different start addresses etc or startup and keyboard/console code let me know.

from cc6303.

kikich10 avatar kikich10 commented on July 17, 2024

Thank you for your help, it works well and I can also inject my asm code.
The codes for keyboards and the console works fine.

For the memory I found this information:


**** Memory Map d'alice 32/90 ****


=========================

  • Variable libre Page 0 *
    =========================
    $20 - $7F (96 octets)
    ==================
  • Pointeur Basic *
    ==================
    $80 - $FF (128 octet) (Potentiellement utilisable en C ou en ASM)
    ===================
  • Variables Basic *
    ===================
    $3000 - $3346 (838 octets) (Espace utilisabl en ASM)
    (En Basic c'est l'espace reservé pour vos variables)
    ===========================
  • Programme Code Alice 32 *
    ===========================
    $3346 - $4FFF (7353 octets)
    ===========================
  • Programme Code Alice 90 *
    ===========================
    $3346 - $AFFF (31930 octets)
    ===========================
  • Extension 16ko Alice 32 *
    ===========================
    $5000 - $8FFF (16383 octets)

from cc6303.

EtchedPixels avatar EtchedPixels commented on July 17, 2024

Thanks for the info

from cc6303.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.