Author Topic: Capitals of Europe  (Read 3915 times)

jj2007

  • Member
  • *****
  • Posts: 11550
  • Assembler is fun ;-)
    • MasmBasic
Capitals of Europe
« on: September 25, 2020, 01:51:46 AM »
Extract the attached archive to any folder, then run the exe; afterwards, click into the map to see an image showing the country's capital. Might be useful as a geography lesson ;-)

Congrats to those who are able to find and select Jan Mayen, the Faeroe Islands, the Isle of Man and Malta :tongue:
« Last Edit: October 11, 2020, 09:56:22 PM by jj2007 »

Vortex

  • Member
  • *****
  • Posts: 2583
Re: Capitals of Europe
« Reply #1 on: September 25, 2020, 03:10:46 AM »
Hi Jochen,

I turned off Windows Defernder but Windows 10 Version 1909 seems to block the application. The application displays a gray colored window disappearing after some seconds.

HSE

  • Member
  • *****
  • Posts: 1741
  • <AMD>< 7-32>
Re: Capitals of Europe
« Reply #2 on: September 25, 2020, 03:20:51 AM »
Code: [Select]
CPU Disasm
Address   Hex dump          Command                                  Comments
00401EEC  |.  58            POP EAX
00401EED  |.  FF32          PUSH DWORD PTR DS:[EDX]
00401EEF  |.  8B52 10       MOV EDX,DWORD PTR DS:[EDX+10]
00401EF2  |.  33C9          XOR ECX,ECX
00401EF4  |>  AC            /LODS BYTE PTR DS:[ESI]
00401EF5  |.  24 1F         |AND AL,1F
00401EF7  |.  8844CA 04     |MOV BYTE PTR DS:[ECX*8+EDX+4],AL  <<<<<<<<<<< Access violation when writing
00401EFB  |.  41            |INC ECX
00401EFC  |.  3B0C24        |CMP ECX,DWORD PTR SS:[ESP]
00401EFF  |.^ 72 F3         \JB SHORT 00401EF4
00401F01  |.  5A            POP EDX
00401F02  |.  5E            POP ESI
00401F03  |.  59            POP ECX
00401F04  |.  6A 00         PUSH 0                                   ; /Arg4 = 0
00401F06  |.  6A 00         PUSH 0                                   ; |Arg3 = 0
00401F08  |.  6A 07         PUSH 7                                   ; |Arg2 = 7
00401F0A  |.  68 78E14000   PUSH OFFSET 0040E178                     ; |Arg1 = ASCII "Capitals\Capitals.ini"
00401F0F  |.  E8 E83F0000   CALL 00405EFC                            ; \MapsAndPhotos.00405EFC
00401F14  |.  53            PUSH EBX
00401F15  |.  E8 300B0000   CALL <JMP.&user32.CreatePopupMenu>       ; [USER32.CreatePopupMenu

jj2007

  • Member
  • *****
  • Posts: 11550
  • Assembler is fun ;-)
    • MasmBasic
Re: Capitals of Europe
« Reply #3 on: September 25, 2020, 04:05:33 AM »
00401EF7  |.  8844CA 04     |MOV BYTE PTR DS:[ECX*8+EDX+4],AL  <<<<<<<<<<< Access violation when writing

It does that if you don't follow the instructions. The exe needs the images.

Extract the attached archive to any folder, then create in that folder a subfolder Capitals and extract all files from this archive to that folder.

Hi Jochen,

I turned off Windows Defernder but Windows 10 Version 1909 seems to block the application. The application displays a gray colored window disappearing after some seconds.

Sorry for that, Erol. It works fine here...
Code: [Select]
This is Windows version 10.0, build 18362
The long story: Windows version 10.0 1903, build 18362
running on Intel(R) Celeron(R) CPU  N2840  @ 2.16GHz

Vortex

  • Member
  • *****
  • Posts: 2583
Re: Capitals of Europe
« Reply #4 on: September 25, 2020, 05:58:46 AM »
Hi Jochen,

My apologies, I didn't download the zip archive containing the images. Now, it works fine. Nice work :thumbsup:

HSE

  • Member
  • *****
  • Posts: 1741
  • <AMD>< 7-32>
Re: Capitals of Europe
« Reply #5 on: September 25, 2020, 08:09:24 AM »
Fantastic JJ  :thumbsup:

I almost have forgotten that Europe is an island.  :biggrin: :biggrin:

jj2007

  • Member
  • *****
  • Posts: 11550
  • Assembler is fun ;-)
    • MasmBasic
Re: Capitals of Europe
« Reply #6 on: September 25, 2020, 09:03:06 AM »
Thanks for testing, Erol & HSE. The map is old, unfortunately, it is very difficult to find good free maps on the web. So Russia is missing, and the Balkan is not quite up-to-date. For a demo it's ok, though ;-)

guga

  • Member
  • *****
  • Posts: 1357
  • Assembly is a state of art.
    • RosAsm
Re: Capitals of Europe
« Reply #7 on: September 25, 2020, 11:40:28 AM »
One word. WOW !!!!  :thumbsup: :thumbsup: :thumbsup: :thumbsup: :thumbsup: :thumbsup:
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

Siekmanski

  • Member
  • *****
  • Posts: 2365
Re: Capitals of Europe
« Reply #8 on: September 25, 2020, 04:41:48 PM »
Cool!  :cool:
Creative coders use backward thinking techniques as a strategy.

TimoVJL

  • Member
  • ****
  • Posts: 723
Re: Capitals of Europe
« Reply #9 on: September 25, 2020, 05:24:49 PM »
May the source be with you

caballero

  • Member
  • *****
  • Posts: 1616
  • Matrix - Noah
    • abre ojos ensamblador
Re: Capitals of Europe
« Reply #10 on: September 25, 2020, 06:16:37 PM »
Maybe a bit offtopic here, or maybe not.

The four colours theorem:
The logic of the error is hidden among the most unexpected lines of the program

jj2007

  • Member
  • *****
  • Posts: 11550
  • Assembler is fun ;-)
    • MasmBasic
Re: Capitals of Europe
« Reply #11 on: September 25, 2020, 06:23:01 PM »
Europe in WMF-format:
https://d-maps.com/carte.php?num_car=30080&lang=en

Thanks, Timo. Nice but:
Code: [Select]
239358 svg
574416 wmf
36464 map (my format)

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 8492
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Capitals of Europe
« Reply #12 on: September 25, 2020, 11:21:59 PM »
If you don't mind a few tiny JPG artifacts, you can get Timo's image down to 33k and it still looks OK.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

jj2007

  • Member
  • *****
  • Posts: 11550
  • Assembler is fun ;-)
    • MasmBasic
Re: Capitals of Europe
« Reply #13 on: September 26, 2020, 01:51:36 AM »
If you don't mind a few tiny JPG artifacts, you can get Timo's image down to 33k and it still looks OK.

It needs to be a vector format - the map is not an image. In the meantime I found a map of Europe, very nice and 25k only.

daydreamer

  • Member
  • *****
  • Posts: 1720
  • building nextdoor
Re: Capitals of Europe
« Reply #14 on: September 26, 2020, 06:18:13 AM »
Great Jochen :thumbsup:
SIMD fan and macro fan
why assembly is fastest is because its switch has no (brakes) breaks
:P
only in 16bit assembly you can get away with "Only words" :P