diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..556f8c8 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* binary diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..31a08b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,154 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results + +[Dd]ebug/ +[Rr]elease/ +x64/ +build/ +[Bb]in/ +[Oo]bj/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.scc + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml +*.pubxml + +# NuGet Packages Directory +## TODO: If you have NuGet Package Restore enabled, uncomment the next line +#packages/ + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml +*.pfx +*.publishsettings + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +App_Data/*.mdf +App_Data/*.ldf + + +#LightSwitch generated files +GeneratedArtifacts/ +_Pvt_Extensions/ +ModelManifest.xml + +# ========================= +# Windows detritus +# ========================= + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Mac desktop service store files +.DS_Store diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7fa1744 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM micheldebree/docker-acme:latest AS build +COPY hello.asm /root +RUN acme --cpu 6510 --format cbm --outfile hello.prg hello.asm + +FROM ethomson/cloud64:latest AS runtime +COPY --from=build /root/hello.prg /app/wwwroot/program.prg + +WORKDIR /app diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..95bb2e1 --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ +hello.d64: hello.asm + acme --cpu 6510 --format cbm --outfile hello.prg hello.asm + c1541 -format foo,id d64 hello.d64 -write hello.prg diff --git a/README.md b/README.md new file mode 100644 index 0000000..308eec9 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +Hello World for the Commodore 64 +================================ + +This is a simple "Hello World" application for the Commodore 64 in ACME +6502 assembly. + +Derived from and inspired by +[Sylvain Poitras](https://github.com/spoitras/Hello-World) +and +[Rocco Di Leo](https://dustlayer.com/c64-coding-tutorials/2013/4/8/episode-2-2-writing-to-the-c64-screen). diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..df4fc32 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,45 @@ +# Docker +# Build and push an image to Azure Container Registry +# https://docs.microsoft.com/azure/devops/pipelines/languages/docker + +trigger: +- master + +resources: +- repo: self + +variables: + # Container registry service connection established during pipeline creation + dockerRegistryServiceConnection: 'ethomsondemo-acr' + imageRepository: 'hello64' + containerRegistry: 'ethomsondemo.azurecr.io' + dockerfilePath: '$(Build.SourcesDirectory)/Dockerfile' + tag: '$(Build.BuildId)' + + # Agent VM image name + vmImageName: 'ubuntu-latest' + +stages: +- stage: Build + displayName: Build and push stage + jobs: + - job: Build + displayName: Build + pool: + vmImage: $(vmImageName) + steps: + - task: Docker@2 + displayName: Build and push an image to container registry + inputs: + command: buildAndPush + repository: $(imageRepository) + dockerfile: $(dockerfilePath) + containerRegistry: $(dockerRegistryServiceConnection) + tags: | + $(tag) + - task: AzureWebAppContainer@1 + displayName: Configure Web App with new container image + inputs: + azureSubscription: 'Azure DevOps Community Demo(1a1d858c-e6fb-4704-bdba-70f24b3044c0)' + appName: 'cloud64' + containers: '$(containerRegistry)/$(imageRepository):$(tag)' diff --git a/hello.asm b/hello.asm new file mode 100644 index 0000000..ff861e3 --- /dev/null +++ b/hello.asm @@ -0,0 +1,31 @@ +!cpu 6502 + +; set up basic bootstrapper into 6502 code +* = $0801 +!byte $0d,$08,$dc,$07,$9e,$20,$34,$39 +!byte $31,$35,$32,$00,$00,$00 +* = $c000 + +; clear the screen +jsr $e544 + +; write a line of text; loop +.loop + jsr .write_line + jmp .loop + +; the text to write +message !scr " hello ndc! " + +.write_line + ldx #$00 + +; load the next character from the message and write it to the screen. +; loop until we've reached 40 characters +.write_char + lda message,x + sta $0590,x + inx + cpx #$28 + bne .write_char + rts